﻿/**
 * 
 * Copyright 2009, 2010 Mike Jamer [email: mikejamer@gmail.com ]
 * 
 * This File is part of Moose IRC
 * 
 * MooseIRC is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * MooseIRC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with MooseIRC.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;

namespace moose.irc {
    /// <summary>
    /// Baseclass for IRC Entities, 
    /// I classify things like users and channels as Entities
    /// </summary>
    [CLSCompliant(true)]
    public abstract class IrcEntity : Object {

        /// <summary>
        /// Name of entity
        /// </summary>
        private string m_name;

        /// <summary>
        /// Gets/Sets Entity Name
        /// </summary>
        public string Name {
            get {
                return m_name;
            }
            set {
                m_name = value;
                return;
            }
        }

        /// <summary>
        /// Initialize Irc Entity
        /// </summary>
        /// <param name="name">Entity Name</param>
        public IrcEntity(string name)
            : base() {
            m_name = name;
            return;
        }

        /// <summary>
        /// Send a private message to entity
        /// </summary>
        /// <param name="message">message to send</param>
        public void private_message(IrcSession session, string message) {

            //Send private message to entity
            session.send("PRIVMSG " + m_name + " :" + message);

            return;
        }

    }
}
